package dk.liljedahl.christian.apx.shipdaemon;

import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ExpressionParserTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		ExpressionParser expParser = new ExpressionParser();
		
		expParser.analog[0] = 200;
		expParser.condition[1] = false;
		expParser.script = "" +
		"if(analog[0] > 100) {condition[1] = true}";
		expParser.evaluateEventScript();
		
		if(expParser.condition[1] == true)
		System.out.println("condition[1]=True");

		
		
/*		final Display display = new Display ();
    	final Shell shell = new Shell(display);
    	shell.setSize(300,300);
    	shell.setBounds(315, 0, 300, 300);
    	shell.setText("Ship Daemon");
        shell.setLayout(new RowLayout());
  
        
        
    	shell.open();    	
    	// Default Swt-stuff
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
*/
	}

}
